(function($) {

var oSection = $( 'section' );
var oLink = $( 'a[data-filter]' )

oSection.isotope();

oLink.click(function() {
	oSection.isotope({filter : $(this).data('filter') });	
});


oSection.infinitescroll({
	navSelector  : '#pagination',    // selector for the paged navigation 
	nextSelector : '#pagination a',  // selector for the NEXT link (to page 2)
	itemSelector : '.item',     // selector for all items you'll retrieve
	loading: {
		finishedMsg: 'No more pages to load.',
		img: 'http://i.imgur.com/qkKy8.gif'
	}
},
function( newElements ) {
	oSection.isotope( 'appended', $( newElements ) ); 
});


})(jQuery);
